

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/clock.jpg">
  <link rel="icon" href="/img/clock.jpg">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="lingllqs">
  <meta name="keywords" content="爱编程的少侠">
  
    <meta name="description" content="下载ISO镜像，浏览器中搜索中科大镜像(其它国内镜像也可以)  https:&#x2F;&#x2F;mirrors.ustc.edu.cn&#x2F;archlinux&#x2F;iso&#x2F;latest&#x2F;archlinux-x86_64.iso  制作USB启动盘 Linux系统,使用dd命令  dd if&#x3D;&#x2F;path&#x2F;to&#x2F;archlinux-x86_64.iso of&#x3D;&#x2F;path&#x2F;to&#x2F;disk bs&#x3D;4M status&#x3D;progr">
<meta property="og:type" content="article">
<meta property="og:title" content="ArchLinux安装">
<meta property="og:url" content="https://lingllqs.github.io/archives/ca45cc0a.html">
<meta property="og:site_name" content="少侠的博客">
<meta property="og:description" content="下载ISO镜像，浏览器中搜索中科大镜像(其它国内镜像也可以)  https:&#x2F;&#x2F;mirrors.ustc.edu.cn&#x2F;archlinux&#x2F;iso&#x2F;latest&#x2F;archlinux-x86_64.iso  制作USB启动盘 Linux系统,使用dd命令  dd if&#x3D;&#x2F;path&#x2F;to&#x2F;archlinux-x86_64.iso of&#x3D;&#x2F;path&#x2F;to&#x2F;disk bs&#x3D;4M status&#x3D;progr">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://lingllqs.github.io/img/neofetch.png">
<meta property="og:image" content="https://lingllqs.github.io/img/ping.png">
<meta property="article:published_time" content="2023-05-16T14:41:07.000Z">
<meta property="article:modified_time" content="2023-09-16T15:49:21.980Z">
<meta property="article:author" content="lingllqs">
<meta property="article:tag" content="ArchLinux">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://lingllqs.github.io/img/neofetch.png">
  
  
  
  <title>ArchLinux安装 - 少侠的博客</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  




  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"lingllqs.github.io","root":"/","version":"1.9.5","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"follow_dnt":true,"baidu":"f8764fb24a6f40d929b789fbec8ad09b","google":{"measurement_id":null},"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml","include_content_in_search":true};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  

  
    <!-- Baidu Analytics -->
    <script async>
      if (!Fluid.ctx.dnt) {
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?f8764fb24a6f40d929b789fbec8ad09b";
          var s = document.getElementsByTagName("script")[0];
          s.parentNode.insertBefore(hm, s);
        })();
      }
    </script>
  

  
    <!-- Google tag (gtag.js) -->
    <script async>
      if (!Fluid.ctx.dnt) {
        Fluid.utils.createScript("https://www.googletagmanager.com/gtag/js?id=", function() {
          window.dataLayer = window.dataLayer || [];
          function gtag() {
            dataLayer.push(arguments);
          }
          gtag('js', new Date());
          gtag('config', '');
        });
      }
    </script>
  

  

  

  

  



  
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 70vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>炸天帮</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/" target="_self">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/" target="_self">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/" target="_self">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/" target="_self">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/" target="_self">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/links/" target="_self">
                <i class="iconfont icon-link-fill"></i>
                <span>友链</span>
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" rel="external nofollow noreferrer" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" rel="external nofollow noreferrer" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('/img/default.png') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="ArchLinux安装"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2023-05-16 22:41" pubdate>
          2023年5月16日 晚上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          4.6k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          39 分钟
        
      </span>
    

    
    
  </div>


        
      </div>

      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <h1 id="seo-header">ArchLinux安装</h1>
            
            
              <div class="markdown-body">
                
                <p><img src="/img/neofetch.png" srcset="/img/loading.gif" lazyload alt="neofetch"></p>
<h3 id="下载ISO镜像，浏览器中搜索中科大镜像-其它国内镜像也可以"><strong>下载ISO镜像，浏览器中搜索中科大镜像(其它国内镜像也可以)</strong></h3>
<blockquote>
<p><a target="_blank" rel="noopener external nofollow noreferrer" href="https://mirrors.ustc.edu.cn/archlinux/iso/latest/archlinux-x86_64.iso">https://mirrors.ustc.edu.cn/archlinux/iso/latest/archlinux-x86_64.iso</a></p>
</blockquote>
<h3 id="制作USB启动盘"><strong>制作USB启动盘</strong></h3>
<p>Linux系统,使用dd命令</p>
<blockquote>
<p><code>dd if=/path/to/archlinux-x86_64.iso of=/path/to/disk bs=4M status=progress &amp;&amp; sync</code></p>
</blockquote>
<p>if指定iso镜像,of指定要写入的U盘,bs表示写入的块大小,status表示显示写入信息,sync表示数据同步写入(防止数据出错)</p>
<p>Windows系统</p>
<blockquote>
<p>使用rufus工具，浏览器搜索rufus就行</p>
</blockquote>
<h3 id="重启电脑进入BIOS设置从USB启动"><strong>重启电脑进入BIOS设置从USB启动</strong></h3>
<p>本人的电脑开机时按F2或者DEL键进入，其它的可以根据电脑型号查看官网手册<br>
进入BIOS把USB启动盘的项移动到列表中第一行后保存退出即可，本人是开机后按F12直接可以选择启动项<br>
这一步完成后就进入到了archlinux的live-USB环境，相当于进入了U盘所在的系统，<br>
这个系统提供了一些基本工具可以供你使用，以此来安装archlinux到你的硬盘中</p>
<h3 id="配置网络以便安装">配置网络以便安装</h3>
<blockquote>
<p>使用iwctl命令进入wifi配置命令行，如果是有线网络可以跳过，因为有线可以直接联网<br>
进入iwctl工具命令行后，使用<code>device list</code>列出可以使用的网卡设备名称，一般是wlan0<br>
然后使用<code>station &lt;设备名称&gt; scan</code>来扫描可用的wifi<br>
接着使用<code>station &lt;设备名称&gt; get-network</code>来获取可用网络<br>
最后使用<code>station &lt;设备名称&gt; connect &lt;网络名称&gt;</code>来连接wifi<br>
输入密码回车确认后输入quit退出iwctl工具的命令行，如果连接的是开放网络，也就是不需要密码，直接退出即可<br>
回到字符终端后使用<code>ping -c 3 g.cn</code>测试网络连接是否成功</p>
</blockquote>
<p><img src="/img/ping.png" srcset="/img/loading.gif" lazyload alt="ping"></p>
<h3 id="进行硬盘分区">进行硬盘分区</h3>
<blockquote>
<p>使用cfdisk工具，也可以使用其它的，例如fdisk,gdisk等</p>
</blockquote>
<blockquote>
<p>首先使用<code>fdisk -l</code>命令获取你的电脑中硬盘信息，本人只有一块硬盘/dev/nvme0n1，你的可能是/dev/sda, /dev/sdb, /dev/hdx等</p>
</blockquote>
<blockquote>
<p>使用<code>cfdisk /dev/nvme0n1</code>进入分区的字符操作界面，如果你是没有格式化的硬盘可能会让你选择硬盘的分区表,<br>
一般来说选择gpt就行，界面上方列出了你的硬盘分区信息，下方是操作项。<br>
如果你不需要保留硬盘数据，选中有数据的分区使用方向键选择下方的delete选项删除，此时该分区就会标记为free space</p>
</blockquote>
<blockquote>
<p>开始分区，一般情况下分三个区就行</p>
<ul>
<li>
<p>第一个分区引导分区，这是对efi引导方式来说，除非你的电脑很老不支持efi，方向键选择free space分区然后选择下方new选项，<br>
然后输入512M(300M~500M即可)，回车确认，接着选择type选项，选择efi system类型。</p>
</li>
<li>
<p>第二个分区是交换分区，本人没有使用，这个分区对于内存小的电脑来说很有必要，本人电脑16g内存，所以没有使用<br>
如果你需要交换分区，分配4g大小一般就行，如果你的内存大小比较特别百度一下，type选择linux swap.</p>
</li>
<li>
<p>第三个分区是根分区(/)，也就是系统安装的分区，把所有的free space分配给它就行，type选择linux filesystem.</p>
</li>
<li>
<p>如果你想更精细的管理，也可以从根分区(/)中划分一部分大小分配给/home分区，类似于windows的D盘，当你需要重装系统时<br>
可以不删除/home分区来保留数据，type选择和根分区一样即可，当然还可以划分其他分区单独出来，具体作用百度一下。</p>
</li>
</ul>
</blockquote>
<blockquote>
<p>最后一步选择write选项确认，注意这一步前你还可以反悔，一旦write后硬盘数据就没了，然后选择quit推出cfdisk。</p>
</blockquote>
<h3 id="格式化分区">格式化分区</h3>
<blockquote>
<p>通过<code>lsblk</code>命令查看分区编号，我的是/dev/nvme0n1p1, /dev/nvme0n1p2。你的可能是/dev/sda1, /dev/sda2, /dev/sda3等。<br>
格式化引导分区(有的话): <code>mkfs.vfat /dev/引导分区编号</code><br>
格式化根分区: <code>mkfs.ext4 /dev/根分区编号</code><br>
格式化交换分区(有的话): <code>mkswap /dev/交换分区编号</code><br>
使用<code>lsblk -f</code>命令查看分区信息</p>
</blockquote>
<h3 id="挂载分区">挂载分区</h3>
<blockquote>
<span class="label label-注意！ red"></span> 首先挂载根分区: `mount /dev/根分区编号 /mnt`，将根分区挂载到/mnt下
<p>挂载引导分区: <code>mount --mkdir /dev/引导分区编号 /mnt/boot/efi</code>, 就引导分区挂载到/mnt/boot/efi下，–mkdir参数表示没有该目录就创建<br>
启用交换分区: <code>swapon /dev/交换分区</code><br>
使用<code>lsblk -f</code>查看分区信息</p>
</blockquote>
<h3 id="接下来就可以开始安装系统了">接下来就可以开始安装系统了</h3>
<blockquote>
<p>在此之前我们先配置一下安装源，默认是archlinux官方的源，下载速度比较慢。<br>
这里用两种方式:</p>
<ul>
<li>
<p>第一种: 编辑/etc/pacman.d/mirrorlist文件，使用<code>vim /etc/pacman.d/mirrorlist</code>命令打开，键盘按下gg跳转到第一行，输入大写O在<br>
当前行的上一行新建一行并进入插入模式，然后输入https://mirrors.ustc.edu.cn/archlinux/<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mi>e</mi><mi>p</mi><mi>o</mi><mi mathvariant="normal">/</mi><mi>o</mi><mi>s</mi><mi mathvariant="normal">/</mi></mrow><annotation encoding="application/x-tex">repo/os/</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">re</span><span class="mord mathnormal">p</span><span class="mord mathnormal">o</span><span class="mord">/</span><span class="mord mathnormal">os</span><span class="mord">/</span></span></span></span>arch(这是中科大的源，也可以使用清华的)<br>
按<Esc>键退出插入模式，按Shift+分号来输入冒号(:)进入命令行模式，输入wq保存退出。</p>
</li>
<li>
<p>第二种: 使用reflector命令，<code>reflector --country China --latest 5 --sort rate --protocol https --save /etc/pacman.d/mirrorlist</code><br>
参数含义: --country表示指定国家，–latest表示使用最近同步过的5个源，–sort表示按照网速排序，–protocol表示使用https协议，–save表示要保存位置</p>
</li>
</ul>
</blockquote>
<p><strong>接着更新软件源</strong></p>
<blockquote>
<p><code>pacman -Syy</code></p>
</blockquote>
<p><strong>安装archlinux-keyring包</strong></p>
<blockquote>
<p><code>pacman -S archlinux-keyring</code></p>
</blockquote>
<p><strong>开始安装基本的系统</strong></p>
<blockquote>
<p><code>pacstrap /mnt base base-devel linux linux-firmware linux-headers</code></p>
</blockquote>
<p><strong>安装其它重要的工具和软件</strong></p>
<blockquote>
<p><code>pacstrap /mnt networkmanager dhcpcd openssh vim git grub os-prober efibootmgr intel-ucode man-db ntfs-3g firefox noto-fonts-cjk noto-fonts-emoji</code></p>
</blockquote>
<p><em>安装说明</em></p>
<table>
<thead>
<tr>
<th style="text-align:center">包</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">base和base-devel</td>
<td>基本的系统软件</td>
</tr>
<tr>
<td style="text-align:center">linux</td>
<td>内核</td>
</tr>
<tr>
<td style="text-align:center">linux-firmware</td>
<td>驱动</td>
</tr>
<tr>
<td style="text-align:center">linux-headers</td>
<td>内核头文件</td>
</tr>
<tr>
<td style="text-align:center">networkmanager</td>
<td>网络管理工具</td>
</tr>
<tr>
<td style="text-align:center">dhcpcd</td>
<td>ip地址动态分配工具</td>
</tr>
<tr>
<td style="text-align:center">openssh</td>
<td>ssh服务</td>
</tr>
<tr>
<td style="text-align:center">vim</td>
<td>编辑工具</td>
</tr>
<tr>
<td style="text-align:center">git</td>
<td>版本管理工具</td>
</tr>
<tr>
<td style="text-align:center">grub</td>
<td>引导系统工具，必装</td>
</tr>
<tr>
<td style="text-align:center">os-prober</td>
<td>双系统必装</td>
</tr>
<tr>
<td style="text-align:center">efibootmgr</td>
<td>UEFI引导必装</td>
</tr>
<tr>
<td style="text-align:center">intel-ucode</td>
<td>CPU微码必装,如果是amd的CPU则装amd-ucode</td>
</tr>
<tr>
<td style="text-align:center">man-db和man-pages</td>
<td>软件包的文档</td>
</tr>
<tr>
<td style="text-align:center">ntfs-3g</td>
<td>双系统必装，用于访问windows系统文件</td>
</tr>
<tr>
<td style="text-align:center">firefox</td>
<td>浏览器，可以安装chromium</td>
</tr>
<tr>
<td style="text-align:center">noto-fonts-cjk和noto-fonts-emoji</td>
<td>字体和emoji</td>
</tr>
</tbody>
</table>
<h3 id="基本的系统安装完毕，接下来配置系统启动的配置">基本的系统安装完毕，接下来配置系统启动的配置</h3>
<p><strong>创建fstab文件,使用genfstab工具</strong></p>
<blockquote>
<p><code>genfstab -U /mnt &gt;&gt; /mnt/etc/fstab</code></p>
</blockquote>
<p>使用<code>cat /mnt/etc/fstab</code>查看是否写入成功</p>
<p><strong>使用arch-chroot命令进入新系统进行一下必要的配置</strong></p>
<blockquote>
<p><code>arch-chroot /mnt</code></p>
</blockquote>
<p><em>设置时区</em></p>
<blockquote>
<p><code>ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime</code></p>
</blockquote>
<p><em>设置硬件时钟</em></p>
<blockquote>
<p><code>hwclock --systohc</code></p>
</blockquote>
<p><em>设置系统语言</em></p>
<p>使用vim工具编辑/etc/locale.gen文件找到en_US.UTF-8 UTF-8和zh_CN.UTF-8 UTF-8这两行，把开头的#删除</p>
<blockquote>
<p><code>vim /etc/locale.gen</code></p>
</blockquote>
<p>按下/键进入搜索模式，输入要查找的内容，回车确认<br>
移动到#号字符，输入x删除光标下的字符<br>
输入冒号(:)进入命令行模式，输入wq回车保存退出</p>
<p><em>生成本地化语言</em></p>
<blockquote>
<p><code>locale-gen</code></p>
</blockquote>
<p><em>编辑/etc/locale.conf文件来配置使用的语言</em></p>
<blockquote>
<p><code>echo &quot;LANG=en_US.UTF-8&quot; &gt; /etc/locale.conf</code></p>
</blockquote>
<p><em>编辑/etc/hostname文件修改主机名</em></p>
<blockquote>
<p><code>echo &quot;你喜欢的名字&quot; &gt; /etc/hostname</code></p>
</blockquote>
<h4 id="设置root用户密码">设置root用户密码</h4>
<blockquote>
<p>passwd root</p>
</blockquote>
<h3 id="配置grub引导系统">配置grub引导系统</h3>
<p>如果是双系统用户，编辑/etc/default/grub文件<br>
把GRUB_DISABLE_OS_PROBER=false那一行前面的#号去掉</p>
<p><em>配置UEFI引导</em></p>
<blockquote>
<p><code>grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB</code><br>
<code>grub-mkconfig -o /boot/grub/grub.cfg</code></p>
</blockquote>
<p><em>如果是传统引导(legacy)方式</em></p>
<blockquote>
<p><code>grub-install --target=i386-pc &lt;硬盘号&gt;</code><br>
<code>grub-mkconfig -o /boot/grub/grub.cfg</code></p>
</blockquote>
<h3 id="启动一些服务-开机自启动">启动一些服务(开机自启动)</h3>
<blockquote>
<p><code>systemctl enable sshd NetworkManager dhcpcd</code></p>
</blockquote>
<h3 id="创建普通用户">创建普通用户</h3>
<blockquote>
<p><code>useradd -m -G wheel &lt;你喜欢的用户名&gt;</code></p>
</blockquote>
<p>-m 表示创建家目录，-G表示将该用户加入的wheel(默认系统已有这个组)这个用户组里面，以便普通用户可以使用一些管理员的操作</p>
<p><em>编辑/etc/sudoers文件</em></p>
<blockquote>
<p><code>vim /etc/sudoers</code></p>
</blockquote>
<p>找到%wheel ALL=(ALL:ALL) ALL那一行去掉#号注释，保存退出</p>
<p><em>给用户设置密码</em></p>
<blockquote>
<p><code>passwd &lt;你的用户名&gt;</code></p>
</blockquote>
<h3 id="安装完毕可以退出然后重启进入全新的系统了">安装完毕可以退出然后重启进入全新的系统了</h3>
<blockquote>
<p><code>exit</code><br>
<code>umount -R /mnt</code><br>
<code>reboot</code></p>
</blockquote>
<h2 id="大功告成，再做一点点工作就可以进入你独享的moment了">大功告成，再做一点点工作就可以进入你独享的moment了</h2>
<h3 id="配置网络">配置网络</h3>
<p><em>连接wifi</em></p>
<blockquote>
<p><code>nmcli device wifi connect &lt;wifi名&gt; password &lt;密码&gt;</code></p>
</blockquote>
<p><em>配置AUR源</em></p>
<p>编辑/etc/pacman.conf文件，在末尾添加如下内容:</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs C++">[archlinuxcn]<br>Server = https:<span class="hljs-comment">//mirrors.ustc.edu.cn/archlinuxcn/$arch</span><br></code></pre></td></tr></table></figure>
<p>更新</p>
<blockquote>
<p><code>sudo pacman -Syy</code></p>
</blockquote>
<h3 id="安装窗口管理器-dwm-bspwm-i3wm-hyprland-或集成桌面环境-gnome-kde-xfce">安装窗口管理器(dwm bspwm i3wm hyprland)或集成桌面环境(gnome kde xfce)</h3>
<h4 id="dwm安装">dwm安装</h4>
<p><em><strong>下载我的配置</strong></em></p>
<blockquote>
<p><code>git clone https://github.com/lingllqs/dotfile.git ~/dotfile</code><br>
<code>cd ~/dotfile &amp;&amp; chmod +x ./dwm_install.sh</code><br>
<code>bash ./dwm_install.sh</code></p>
</blockquote>

                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E6%95%99%E7%A8%8B/" class="category-chain-item">教程</a>
  
  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/ArchLinux/" class="print-no-link">#ArchLinux</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>ArchLinux安装</div>
      <div>https://lingllqs.github.io/archives/ca45cc0a.html</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>lingllqs</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2023年5月16日</div>
        </div>
      
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a class="print-no-link" target="_blank" href="https://creativecommons.org/licenses/by/4.0/" rel="external nofollow noreferrer">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/archives/118b8ca3.html" title="编译原理">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">编译原理</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/archives/8ac0bc3c.html" title="猜数字">
                        <span class="hidden-mobile">猜数字</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  
  
    <article id="comments" lazyload>
      
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"ZtaCuooNxUcOqZ44oEeRZvpa-gzGzoHsz","appKey":"ZQm92JiXmMQqpk6hi7Zqoi0w","path":"window.location.pathname","placeholder":null,"avatar":"retro","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":true,"recordIP":false,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":true},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="margin-left: -1rem">
    <div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>
  </div>
</div>





  



  



  



  



  


  
  









    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
    </div>
  
  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.4/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.20.1/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  
      <script>
        if (!window.MathJax) {
          window.MathJax = {
            tex    : {
              inlineMath: { '[+]': [['$', '$']] }
            },
            loader : {
              load: ['ui/lazy']
            },
            options: {
              renderActions: {
                insertedScript: [200, () => {
                  document.querySelectorAll('mjx-container').forEach(node => {
                    let target = node.parentNode;
                    if (target.nodeName.toLowerCase() === 'li') {
                      target.parentNode.classList.add('has-jax');
                    }
                  });
                }, '', false]
              }
            }
          };
        } else {
          MathJax.startup.document.state(0);
          MathJax.texReset();
          MathJax.typeset();
          MathJax.typesetPromise();
        }

        Fluid.events.registerRefreshCallback(function() {
          if ('MathJax' in window && MathJax.startup.document && typeof MathJax.startup.document.state === 'function') {
            MathJax.startup.document.state(0);
            MathJax.texReset();
            MathJax.typeset();
            MathJax.typesetPromise();
          }
        });
      </script>
    

  <script  src="https://lib.baomitu.com/mathjax/3.2.2/es5/tex-mml-chtml.js" ></script>

  <script  src="/js/local-search.js" ></script>





<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
